package com.transaction.manage.service;

import com.transaction.manage.localMapper.ChannelInfoMapper;
import com.transaction.manage.localMapper.DictMapper;
import com.transaction.manage.localMapper.FundInfoMapper;
import com.transaction.manage.model.vo.ComboboxVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ComboboxService {

    @Autowired
    private DictMapper dictMapper;

    @Autowired
    private ChannelInfoMapper channelInfoMapper;

    @Autowired
    private FundInfoMapper fundInfoMapper;

    @Transactional(propagation = Propagation.SUPPORTS)
    public List<ComboboxVo> selectAllChildrenByDictKey(String key) {
        return dictMapper.selectAllChildrenByDictKey(key);
    }

    @Transactional(propagation = Propagation.SUPPORTS)
    public List<ComboboxVo> selectValidChannelInfoCombobox() {
        return channelInfoMapper.selectValidChannelInfoCombobox();
    }

    @Transactional(propagation = Propagation.SUPPORTS)
    public List<ComboboxVo> selectValidFundInfoCombobox(String channelCode) {
        return fundInfoMapper.selectValidFundInfoCombobox(channelCode);
    }

    @Transactional(propagation = Propagation.SUPPORTS)
    public List<ComboboxVo> selectTransRateFundInfoCombobox(String channelCode) {
        return fundInfoMapper.selectTransRateFundInfoCombobox(channelCode);
    }

    @Transactional(propagation = Propagation.SUPPORTS)
    public List<ComboboxVo> selectOpenFundInfoCombobox(String channelCode) {
        return fundInfoMapper.selectOpenFundInfoCombobox(channelCode);
    }

}
